Optimal. Leaf size=86 \[ \frac {2 a \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{d (a-b)^{3/2} (a+b)^{3/2}}-\frac {b \tan (c+d x)}{d \left (a^2-b^2\right ) (a+b \sec (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.10, antiderivative size = 86, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {3833, 12, 3831, 2659, 208} \[ \frac {2 a \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{d (a-b)^{3/2} (a+b)^{3/2}}-\frac {b \tan (c+d x)}{d \left (a^2-b^2\right ) (a+b \sec (c+d x))} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 208
Rule 2659
Rule 3831
Rule 3833
Rubi steps
\begin {align*} \int \frac {\sec (c+d x)}{(a+b \sec (c+d x))^2} \, dx &=-\frac {b \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))}-\frac {\int \frac {a \sec (c+d x)}{a+b \sec (c+d x)} \, dx}{-a^2+b^2}\\ &=-\frac {b \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))}+\frac {a \int \frac {\sec (c+d x)}{a+b \sec (c+d x)} \, dx}{a^2-b^2}\\ &=-\frac {b \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))}+\frac {a \int \frac {1}{1+\frac {a \cos (c+d x)}{b}} \, dx}{b \left (a^2-b^2\right )}\\ &=-\frac {b \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))}+\frac {(2 a) \operatorname {Subst}\left (\int \frac {1}{1+\frac {a}{b}+\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{b \left (a^2-b^2\right ) d}\\ &=\frac {2 a \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{3/2} (a+b)^{3/2} d}-\frac {b \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.23, size = 83, normalized size = 0.97 \[ \frac {\frac {b \sin (c+d x)}{(b-a) (a+b) (a \cos (c+d x)+b)}-\frac {2 a \tanh ^{-1}\left (\frac {(b-a) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}}}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.52, size = 332, normalized size = 3.86 \[ \left [-\frac {{\left (a^{2} \cos \left (d x + c\right ) + a b\right )} \sqrt {a^{2} - b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right ) + 2 \, {\left (a^{2} b - b^{3}\right )} \sin \left (d x + c\right )}{2 \, {\left ({\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} d \cos \left (d x + c\right ) + {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} d\right )}}, \frac {{\left (a^{2} \cos \left (d x + c\right ) + a b\right )} \sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right ) - {\left (a^{2} b - b^{3}\right )} \sin \left (d x + c\right )}{{\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} d \cos \left (d x + c\right ) + {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} d}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.24, size = 150, normalized size = 1.74 \[ -\frac {2 \, {\left (\frac {{\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a - 2 \, b\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )} a}{{\left (a^{2} - b^{2}\right )} \sqrt {-a^{2} + b^{2}}} - \frac {b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a - b\right )} {\left (a^{2} - b^{2}\right )}}\right )}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.34, size = 118, normalized size = 1.37 \[ \frac {\frac {2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (a^{2}-b^{2}\right ) \left (a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b -a -b \right )}+\frac {2 a \arctanh \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a -b \right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\left (a -b \right ) \left (a +b \right ) \sqrt {\left (a -b \right ) \left (a +b \right )}}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.04, size = 92, normalized size = 1.07 \[ \frac {2\,a\,\mathrm {atanh}\left (\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a-b}}{\sqrt {a+b}}\right )}{d\,{\left (a+b\right )}^{3/2}\,{\left (a-b\right )}^{3/2}}-\frac {2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a+b\right )\,\left (a-b\right )\,\left (\left (b-a\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a+b\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\sec {\left (c + d x \right )}}{\left (a + b \sec {\left (c + d x \right )}\right )^{2}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________